home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PASCAL / 0195.ZIP / MOVEFILE.PAS < prev    next >
Pascal/Delphi Source File  |  1984-12-17  |  854b  |  31 lines

  1. {@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
  2. The purchaser of these procedures and functions may include them in COMPILED
  3. programs freely, but may not sell or give away the source text.
  4.  
  5. This program uses the procedure MOVE to move a file from one subdirectory to
  6. another, possibly renaming it in the process.}
  7.  
  8. {@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
  9. program Move_File;
  10. {$I filename.typ}
  11. {$I regpack.typ}
  12. {$I movefile.lib}
  13. {$I errmessg.lib}
  14. var
  15.   Old, New : filename_type;
  16.   error    : byte;
  17. begin
  18.   Write('Move: ');
  19.   ReadLn(Old);
  20.   Write('To: ');
  21.   ReadLn(New);
  22.   MOVEFILE(Old,New,error);
  23.   if error = 0 then
  24.     begin
  25.       WriteLn('Sucessfully moved ',old);
  26.       WriteLn('               to ',new);
  27.     end
  28.   else
  29.     WriteLn(message(error));
  30. end.
  31.